<?php
/*
* Plugin Name: Personalized read more
* Plugin URI: http://aaron.jorb.in
* Description: Make the read more link personalized for logged in users
* Version: 0.0
* Author: Aaron Jorbin
* Author URI: http://aaron.jorb.in
*/
/*
 * 		Copywrite 2010 Aaron Jorbin (aaron@jorb.in)
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without weven the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

add_filter('the_content_more_link', 'jorbin_the_content_more_link_filter', 10, 2);

function jorbin_the_content_more_link_filter($original, $more_link_text){
    global $post;

    if( is_user_logged_in() ) {
	global $current_user;
	get_currentuserinfo();
	$more_link_text = "Hey {$current_user->display_name}, why don't you read more";
    }

    return  '<a href="' . get_permalink() . "#more-{$post->ID}\" class='more-link'>$more_link_text</a>";



}
